package com.ajc.seata.controller;

import com.ajc.seata.service.BankService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.orm.jpa.JpaProperties;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.transaction.*;

/**
 * @Author: AnJunchao
 * @Description:
 * @Date: Create in 2019-10-08 17:28:55
 * @Modified By:
 */
@RestController
@RequestMapping("/bank")
public class BankController {
@Autowired
private BankService bankService;
    @Autowired
    JpaProperties jpaProperties;
    @GetMapping("/updateBank")
    public String updateBankofAccount(@RequestParam("amount") Double amount) throws HeuristicRollbackException, HeuristicMixedException, NotSupportedException, RollbackException, SystemException {
        return  bankService.updateBankofAccount(amount);
    }
}
